﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebRozklad.Models;
 

namespace WebRozklad.Controllers
{
    public class RozkladController : Controller
    {
        RozkladJazdyEntities storeDB = new RozkladJazdyEntities();
        //
        // GET: /Rozklad/

        public ActionResult Index()
        {
            var genres = storeDB.Linies.ToList();
            return View(genres);

        }
       
        //
        // GET: /Store/Browse?linia=57
        public ActionResult Browse(string linia)
        {
            // Retrieve Linia and its Associated LiniePrzystanki from database
            var genreModel = storeDB.Linies.Include("LiniePrzystanki")
            .Single(g => g.NrLini == linia);
            return View(genreModel);
        }
     
        //
        // GET: /Store/Details/5
        public ActionResult Details(int id)
        {
            var przystanek = storeDB.LiniaPrzystaneks.Find(id);

            return View(przystanek);
        }

    }
}
